-
Notifications
You must be signed in to change notification settings - Fork 67
feat: implement expression evaluator #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@zhjwpku @HuaHuaY @HeartLinked PTAL |
|
|
||
| class Evaluator::EvalVisitor : public BoundVisitor<bool> { | ||
| public: | ||
| void UpdateRow(const StructLike* row) { row_ = row; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can create a new object in Evaluator::Eval like java's implementation and change UpdateRow to constructor. So we don't need ICEBERG_DCHECK(row_, "Row is not set") in every methods.
| } | ||
|
|
||
| Result<bool> NotNull(const std::shared_ptr<BoundTerm>& term) override { | ||
| ICEBERG_DCHECK(row_, "Row is not set"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a strong opinion, we could adopt the same pattern used for Eq/NotEq, where NotXXX calls XXX and returns !result. Ditto for Lt/GtEq and Gt/LtEq.
|
|
||
| class Evaluator::EvalVisitor : public BoundVisitor<bool> { | ||
| public: | ||
| void UpdateRow(const StructLike* row) { row_ = row; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: SetRow? since this method doesn't update anything.
No description provided.